package com.jx.driving.response;

import com.jx.driving.message.TimeTerminalResponseMessage;
import com.jx.driving.protocol.terminal.annotation.ByteAnnotation;
import com.jx.driving.protocol.terminal.annotation.LimitedStringAnnotation;
import com.jx.driving.protocol.terminal.annotation.StringAnnotation;
import com.jx.driving.protocol.terminal.annotation.TerminalAnnotation;
import com.jx.driving.protocol.terminal.annotation.WordAnnotation;

/**
 * 终端注册应答
 * 
 * @author shenliuyang
 *
 *         2016年8月9日下午2:04:10
 */
@TerminalAnnotation
public class Terminal0x8100Response extends TimeTerminalResponseMessage {
    @WordAnnotation(order = 1)
    private int sequence;// 应答流水号
    @ByteAnnotation(order = 2)
    private short result;// 注册结果0：成功；1：车辆已被注册；2：数据库中无该车辆；3：终端已被注册；4：数据库中无该终端。
    // 只有在成功后才返回以下内容
    @LimitedStringAnnotation(value = 5, order = 3)
    private String platform;// 平台编号
    @LimitedStringAnnotation(value = 16, order = 4)
    private String traningOrg;// 培训机构编号
    @LimitedStringAnnotation(value = 16, order = 5)
    private String device;// 计时终端编号
    @LimitedStringAnnotation(value = 12, order = 6)
    private String certPassword;
    @StringAnnotation(order = 7)
    private String cert;// 终端证书

    public int getSequence() {
	return sequence;
    }

    public void setSequence(int sequence) {
	this.sequence = sequence;
    }

    public short getResult() {
	return result;
    }

    public void setResult(short result) {
	this.result = result;
    }

    public String getPlatform() {
	return platform;
    }

    public void setPlatform(String platform) {
	this.platform = platform;
    }

    public String getTraningOrg() {
	return traningOrg;
    }

    public void setTraningOrg(String traningOrg) {
	this.traningOrg = traningOrg;
    }

    public String getDevice() {
	return device;
    }

    public void setDevice(String device) {
	this.device = device;
    }

    public String getCert() {
	return cert;
    }

    public void setCert(String cert) {
	this.cert = cert;
    }

    public String getCertPassword() {
	return certPassword;
    }

    public void setCertPassword(String certPassword) {
	this.certPassword = certPassword;
    }

    @Override
    public String toString() {
	StringBuilder builder = new StringBuilder();
	builder.append("Terminal0x8100Response [sequence=").append(sequence).append(", result=").append(result)
		.append(", platform=").append(platform).append(", traningOrg=").append(traningOrg).append(", device=")
		.append(device).append(", certPassword=").append(certPassword).append(", cert=").append(cert)
		.append("]");
	return builder.toString();
    }

}
